UAV path planning based on third-party risk modeling

Drones play an important role in modern cities, they bring convenience but also bring corresponding risks. Falling drones can cause casualties or damage to urban facilities and serious property damage, which increases the third-party risk problem. An effective way to reduce these third-party risks is to avoid high-risk areas in path planning, but most current path planning methods are optimized to minimize flight distance, and third-party risk costs are rarely considered. In this paper, a comprehensive risk-cost UAV path planning method is proposed, which evaluates urban risk by establishing a third-party risk model that incorporates obstacle risk, death risk, and property loss risk. This paper proposes a Min-cost A* algorithm based on city risk assessment, and smooths the generated low-risk path through the improved Floyd algorithm. The results show that the path planning method can effectively reduce the risk in the flight path, improve the reliability of the UAV flight path in the urban environment, and solve the problem of planning the third-party risk path of the UAV.

UAVs are a core component of urban air mobility 1,2 and play an important role in smart city initiatives.As one of the key factors in autonomous flight, UAV path planning includes important links such as environmental modeling, path search, and path smoothing 3 .Common UAV path planning studies include the study of minimizing operational risks 4 , minimizing operating costs 5 , modeling the airspace environment, and optimizing the UAV path planning algorithm 6 .
For the problem of risk assessment in unmanned aerial vehicle (UAV) operations, researchers have proposed a UAV falling death probability calculation model, which effectively evaluates the risk of UAVs to road network safety by introducing factors such as spatial occlusion, accident occurrence probability, and risk exposure time 7,8 .In subsequent studies, researchers have provided data on different levels of damage caused by UAVs falling and impacting the human head, considering different heights and masses 9 .These data provide a basis for assessing the risks posed by UAV operations to ground personnel.Based on the classification of failure causes and failure modes in UAV operations, a risk assessment model based on Bayesian networks has been established 10 .This model can calculate the probabilities of ground collision accidents and intermediate events under different operating conditions.As the research progresses, researchers have proposed a UAV operating risk assessment model in urban environments, where collision probability is used to quantify each risk cost.They have addressed the trade-off between path integral risk measures and classical path efficiency by defining the problem of minimizing operational risk for multiple UAVs in partially unknown environments within a multi-criteria optimization framework 11,12 .Although the aforementioned studies have assessed the risks that UAVs may pose during flight, the evaluation models tend to focus on specific risks and have not established a comprehensive model for the integrated assessment of multiple risks.
In recent years, third-party risk analysis and modeling of UAVs have become a hot research topic.The personnel on board the aircraft (crew members and passengers) and those working within the airport are referred to as the first and second parties, respectively 13 .By introducing social and individual risk indicators, third-party risk is defined as safety concerns and property loss involving individuals or entities other than the UAV itself 14,15 .Assessing third-party risks is significant in UAV path planning for evaluating path risks.Researchers have planned cost-effective paths by analyzing risk factors associated with pedestrians, vehicles, and manned aircraft in urban environments 16 .Currently, factors such as obstacles 17 , weather conditions 18 , and other vehicles 19 are considered to be third-party risk factors affecting UAV path planning.However, most studies only consider a single thirdparty risk and do not take into account the UAV's own performance, leading to a singularized risk assessment and overly idealized path planning.To address this issue, this study extends third-party risk to include obstacle risk, fatality risk, and property loss risk in the risk modeling.A comprehensive UAV path planning model that considers third-party risks and incorporates the UAV's own performance characteristics (such as bank angle,

Background of the problem UAV description
A drone, or Unmanned Aerial Vehicle (UAV), is an aircraft capable of flying without the direct control of a human operator.Drones can be categorized into several types, including fixed-wing UAVs, multirotor UAVs, and singlerotor UAVs.Multirotor UAVs offer advantages such as vertical takeoff and landing capabilities, stable hovering, maneuverability, and payload-carrying capacity.These advantages have led to the widespread use of multirotor UAVs in various fields, including smart cities, aerial photography, surveillance, reconnaissance, and search and rescue operations.Therefore, this paper focuses on the study of quadcopter UAVs, a type of multirotor UAV.

Risk factors in urban environment
The types of drone risks vary depending on the operating environment.For example, in a factory environment, the main risks are the risk of obstacles 26 , and in residential areas are mainly risk of crowd density, vehicle density, and noise impact 27,28 .In urban environments, the flight risks of drones include the risks to ground vehicles 19,29 , risks to ground personnel 14,15 , risks of collision between small UAV and manned UAVs in the air [30][31][32] , risks of UAVs operation 34 , noise effects 33 , etc.As shown in Fig. 1, in the urban environment, the population, buildings, and other space obstacles are the main risk factors affecting the operation of drones.
For the urban operation environment, this article mainly studies the following risks: 1. Obstacle risk: the risk of drones in the operation of urban environments due to obstacles such as office buildings and residential buildings; 2. Death risk: drones hit pedestrians and buildings on the ground, causing casualties; 3. Property loss risk: UAV hitting urban infrastructure or high-rise buildings during flight and causing property damage; In urban environments, people, buildings, and obstacles are distributed discretely.To quantitatively evaluate risks in the urban operating environment, as shown in Fig. 2, this document divides the low-altitude urban airspace into discrete three-dimensional gas block units and performs UAV path planning based on the above risks.

Symbol definitions
This study investigates the comprehensive risk-cost path planning of drones considering third-party risks.In the examination and modeling of the problem, multiple equations and symbols were employed.Table 1 presents the definitions and explanations of all the symbols used in this study, elaborating their respective meanings.

Obstacle risk model
Physical barriers in cities include static objects such as buildings, power grids, and trees, as shown in Fig. 3. UAVs have a higher probability of touching obstacles during climbing, turning, and other actions.Therefore, obstacle risk is considered the fundamental risk type in three-dimensional path planning.
In UAV path planning, common methods for assessing obstacles include grid maps and probabilistic maps.Grid maps partition the environment into regular grids and assign a state (occupied or unoccupied) to each grid cell, enabling fast collision detection.However, the grid resolution can affect map precision and computational complexity, leading to quantization errors.Probabilistic maps, on the other hand, use probability models to represent the likelihood of obstacle presence at each location in the environment.Common types of probabilistic maps include occupancy grid maps and Gaussian mixture models.This approach requires substantial storage   The volume of obstacles in a three-dimensional gas block cell with side length r V surround (r) The volume of a three-dimensional gas block element with side length r

Death risk ξ
The skin penetration degree The radius of the drone

Indirect death risk r Human
The radius of the person

P crash
The probability that the drone fails to fall P impact The probability that the drone falls to hit people

N p hit
The number of people hit by the drone The mortality rate in the drone accident

E imp
The impact kinetic energy s c The occlusion factor σ p The density of the population σ b The density of the building The average number of casualties caused by a drone colliding with a building A P The contact area (A_P) of the crash between the falling drone and the person

N b_impact
The number of buildings impacted by the drone's fall

S hit
The area expected to be hit by the drone

S b_hit
The

Death risk model
Cities are densely populated, and effective assessment of death risk is a safety prerequisite for drone path planning.Hu 19 and Izdebski 29 defined and evaluated the risk of death in different situations, which improved the safety rate of the terrestrial population.In most studies, the assessment of mortality risk pertains primarily to the evaluation of direct death risk, which refers to the assessment of casualties resulting directly from a UAV's fall.This paper introduces an evaluation of casualties resulting from indirect death risk, encompassing the risk associated with a drone colliding with either a crowd or a structure.The death risk ( D ) is defined as the combined result of the direct death risk D 1 and the indirect death risk D 2 .This comprehensive approach aims to provide a more thorough assessment of the death risk posed by drones operating in urban environments.

Direct death risk
During the flight process, a drone may lose control and experience a fall due to factors such as navigation failure, low battery power, program malfunction, and other reasons.Under normal circumstances, the drone accident can be divided into three stages, as shown in Fig. 4: (1) the drone fails during flight and cannot fly normally; (2) the fault cannot be repaired in time and the drone falls; (3) the falling drone causes damage to personnel on the ground.Pang 4 combined the three stages of drone fall to establish a pedestrian death risk model.This model integrates the probability of drone system failure and descent, the number of individuals hit by the drone, and the probability of fatality after a drone collision to evaluate the death risk.However, this model does not take into account the probability of a drone striking a person during descent.In the context of analyzing the drone descent process, when a drone experiences an accident and enters the third stage (where the falling drone causes injuries to individuals on the ground), this event can be considered an independent occurrence.In other words, the incidence of each descent event does not have a mutual influence on one another.Therefore, the number of fatalities resulting from each descent event can be expressed as the product of the total number of individuals within the drone descent area and the probability of a drone striking a person during descent and subsequently causing a fatality.The probability of a drone striking a person during descent and causing a fatality is equal to the product of probability of a drone system failure and descent, a drone striking a person during descent, and www.nature.com/scientificreports/ a fatality occurring following a drone-person collision.We designate the direct fatality risk resulting from each descent event as D 1 , expressed as: where P crash represents the probability that the drone fails to fall, P impact represents the probability that the drone falls to hit people, N p hit represents the number of people hit by the drone and P p D represents the probability of causing human death after a drone fall impacts a person.
P crash is determined by the reliability of the hardware and software of the unmanned aerial system.According to the research of the Joint Regulatory Organization for Unmanned Aerial Vehicles, 1 × 10 −4 per flight hour (pfh) is used as the minimum accident rate of RPAS (remotely piloted aircraft system), from which the probability of accident can be calculated 9 , this article 1 × 10 −6 is used as the calculation value of the P crash .P p D is related to impact kinetic energy, space shielding factors, etc., and this article uses the method proposed by Dalamagkidis 35 to calculate the probability of death from the accident P p D : where E imp represents the impact kinetic energy and s c represents the occlusion factor, which is an absolute real number in the range of (0,1] 20 .The average value of the s c is 0.5, representing 50% probability of the shock energy causing death, β is the threshold of the shock energy required to cause death when the s c tends to zero 7 .Based on the above research, this article takes α =106 J, β =100 J. This paper combines the physical equations of kinetic energy to calculate the E imp , as shown in Fig. 5, the impact kinetic energy generated by the fall of the drone is related to the mass of the drone itself and the instantaneous landing speed, which is denoted as: where m (kg) is the mass of the falling drone and v is the instantaneous speed of the drone when it lands.
In Eq. ( 3), the number of people hit by the drone ( N p hit ) is related to the density of the ground population ( σ p ) and the area ( S hit ) expected to be hit by the drone, which is denoted as: The expected impact area can be estimated based on the radius of the drone and the radius of the person, which can be expressed as: (3) D 1 = N p hit P crash P impact P p D (4) where r UAV indicates the radius of the drone, depending on the drone model, r Human represents the radius of the person, and the r Human in this study is 0.164 m.P impact is an important factor in the casualties caused by unmanned falls, it reflects the probability that a UAV falls to hit people, and the introduction of P impact can make the death risk assessment closer to the actual situation.Usually, P impact is related to the density of the population on the ground ( σ p ) and the contact area ( A P ) of the crash between the falling drone and the person, this paper adds the skin penetration degree coefficient ( ξ ) based on it.Skin penetration occurs at high kinetic energy density (high energy in a small impact area), and when the drone falls, the carbon fiber frame can cause varying degrees of damage to human skin, which is the direct cause of casualties.Therefore, the introduction of the skin penetration coefficient into the evaluation of the P impact can improve the accuracy of the assessment results, P impact is recorded as: During fall, the drone can hit the head, chest, or abdomen, slightly increasing the value of the A P , and the A P is between 0.25 and 0.6 36 .ξ is an absolute real number whose range is (0,1], the greater value of ξ , the higher the degree of penetration of the skin.
From this analysis, the direct death risk model is as follows: Indirect death risk Drone falls hitting buildings can cause casualties; this paper combines the density of buildings for indirect death risk assessment.The risk of indirect death is D 2 , and the main difference between D 1 and D 2 is that the former emphasizes that the casualties caused by the direct impact of the drone fall are related to the population density, the latter is the indirect casualties caused by drones hitting buildings which related to the density of buildings on the ground, D 2 is recorded as: where P crash indicates the probability of a drone failure to fall, N b_impact indicates the number of buildings impacted by the drone's fall, and N p D indicates the average number of casualties caused by a drone colliding with a building, and its value is 0.75 37 N b_impact is determined by the density of the building ( σ b ) and estimated drone impact area(S b_hit ) , which is denoted as: where S b_hit indicates the estimated drone impact area, and here is the formula for calculating the S b_hit : The indirect death risk assessment model are:

Property loss risk model
Property loss risk refers to the potential losses that may occur when a drone collides with buildings or public infrastructure during its flight, as shown in Fig. 6.Firstly, the magnitude of damage caused by the collision is related to the drone's flight altitude, with higher altitudes resulting in greater energy during a fall and consequently more severe property damage.Secondly, the extent of damage caused by the collision is also dependent on the kinetic energy of the drone during flight, with higher flight speeds leading to greater kinetic energy and the potential for more substantial property damage.This paper assesses property damage caused by variations in drone altitude and flight speed.Property damage risk is defined as follows: where v is the speed of the drone during flight, m is the mass of the drone, h is the change of the drone flight altitude, and g takes 9.8 m/s 2 .( 8)

Planning of the UAV path based on risk cost
To solve the problem of risk-based drone path planning, this article establishes a UAV path planning model that contains obstacle risk, death risk, and property loss risk.We also propose a new A* algorithm named Min-cost A* algorithm.Finally, we improve the Floyd algorithm and use it to smooth the path.

UAV path-planning model based on third-party risk
The UAV path planning problem with comprehensive risk cost can be regarded as a non-linear optimization problem, and the decision variables are the third-party risks (obstacle risk, death risk, property loss risk) established.The objective function is recorded as: where O represents the cost of obstacles, D represents the death risk, P represents the property damage risk, α 1 , α 2 , α 3 represents the weight factor of each risk, and α 1 +α 2 + α 3 = 1.
In this paper, the relevant performance of the UAV, such as steering angle, climb angle, limit turning radius, flight altitude, endurance time, and minimum step size, are used as constraints to improve the reliability of UAV flight.
Constraints on UAV steering angle: where ϕ max represents the maximum steering angle of the drone, x i , y i , z i represents the current location of the UAV node, x i+1 , y i+1 , z i+1 represents the next location of the UAV node, and x i−1 , y i−1 , z i−1 represents the previous location of the UAV node.

Constraints on UAV climbing angle:
where θ max represents the maximum climb angle of the drone, and θ i is the climbing angle of the current position.Constraints on UAV turning radius: where r i indicates the turning radius of the current position of the drone, r min indicates the limit turning radius, v min indicates the minimum flight speed, and n ymax indicates the maximum normal overload of the drone.In urban environments, the flight altitude of UAVs is not only related to the performance of UAVs themselves, but also limited by the urban UAV flight management system, and the UAV flight altitude constraints are as follows: www.nature.com/scientificreports/Among them h i indicates the current flight altitude of the drone and H min and H max represent the minimum flight altitude and maximum flight altitude of the drone restricted by the city.
The endurance time of the drone is affected by the battery level, so the flight time should be strictly less than the endurance time, and the flight time constraints of the drone are as follows: where n i=1 t i indicates the total UAV flight time from the departure point to the current location, and t max indicates the maximum UAV endurance time.
In the actual flight of the drone, the constraint of the shortest distance that must fly directly before changing the flight attitude is called the minimum step length constraint, which can improve the reliability of the UAV attitude adjustment process, and the minimum step length constraint as follows: Among them, l i indicates the step length of the drone to make attitude adjustment in the current position, and l represents the minimum step length.
In summary, the risk-based cost UAV path planning model can be expressed as follows:

Path-planning solution algorithm based on risk cost
This section details path planning solutions based on risk costs, that is, the Min-cost A* algorithm.The algorithm retains the characteristics of the A* algorithm that responds quickly to the environment, and we improve the cost function and heuristic function accordingly to improve the accuracy and speed of the algorithm.We also calculate the weight factors of risks by the analytic hierarchy method and smooth the risk path by the improved Floyd algorithm.

Min-cost A*algorithm
The A* algorithm is a heuristic algorithm, the basic idea is that when the drone starts to run, use the environmental prior information to calculate the cost between points, the algorithm marks the selected points as a set M, and the unselected point set is recorded as N.At the beginning of the algorithm, only the initial point exists in the set M, and N contains other nodes except the starting point, select the path point with the lowest cost to join the set M, and then update the information from the M and N set.Continue selecting the point in N that costs the least to reach the point in M until the shortest path is obtained.Equation ( 24) is the node priority calculation method of the A* algorithm.During execution of the algorithm, the node with the smallest value of f (n) will be the next node to search.
where f (n) is the comprehensive priority of node n , g(n) is the cost of the node n from the starting point, and h(n) is the estimated cost of node n from the endpoint, that is, the heuristic function of the A* algorithm.A commonly used heuristic function is to represent the cost in terms of distance, that is, the shortest distance.In distance-based environments, commonly used distances are Manhattan distance or Euclidean distance, as shown in Fig. 7a.However, in a risk-based environment, as shown in Fig. 7b, the distribution of risk cost values in different spatial units is uneven and unpredictable, and it is difficult to obtain suitable heuristic values, but h(n) is critical to the accuracy and speed of the algorithm.
The A* algorithm must be able to find the shortest path when h(n) is always less than or equal to the cost of the node n to the endpoint.But in this case, the number of nodes searched by the algorithm increases, and the speed of the algorithm decreases.The A* algorithm can quickly find the optimal path when h(n) is equal to the cost from node n to the endpoint.However, it is difficult to achieve this effect in the actual situation because it is difficult to calculate how far the distance is before the end.If the value of h(n) is more expensive than the node n (20) to the endpoint, the A* algorithm is unlikely to find the shortest path, but the algorithm is fast.In extreme cases, when the heuristic function h(n) is always 0, g(n) will determine the priority of the node, which is the Dijkstra algorithm.At the other extreme, if h(n) is much larger than g(n) , this is the best priority search.
Combined with the above analysis, aiming at the selection of the heuristic function in the risk-cost environment and the UAV path planning problem-based on risk cost, this paper improves the cost function and heuristic function of the traditional A* algorithm and proposes the Min-cost A* calculation, which is as follows.
Based on the minimum cost function g(n) under the influence of multiple factors, the Min-cost A* algorithm avoids the problem that the traditional A* algorithm only calculates the flight range and adds third-party risk generation value.The cost function of the Min-cost A* algorithm is the objective function of the UAV path planning model based on risk cost, expressed as: where G cost (n) represents the cost function of the Min-cost A* algorithm, O represents the risk of obstacles, D represents the risk of death, P represents the risk of property damage, α 1 + α 2 + α 3 = 1 The heuristic function of the Min-cost A* algorithm are as follows: where is the heuristic function after the first optimization of the Min-Cost A* algorithm, X next is the estimated risk cost of the next search node, d(n) is the Euclidean distance from the current node to the endpoint, and the calculation formula is: where x i , y i , z i represents the current search node and x end , y end , z end represents the endpoint.In case the algorithm fails to find an optimal solution due to too large a heuristic value, we optimize the heuristic function again, and the optimization strategy is as follows: where H * cost (n) represents the final heuristic function of the Min-Cost A* algorithm, A represents the Manhattan distance from the current node x i l, y i , z i to the endpoint x end , y end , z end and B is the Manhattan distance from the current node to the starting point x start , y start , z start .The calculation formula is: According to Eq. ( 28), the algorithm can be improved to set the adaptive heuristic function weights.The farther the distance from the current position to the endpoint, the more risk factors and the greater weight of the heuristic.Therefore, the combined cost of the Min-cost A* algorithm is expressed as: The Min-cost A* algorithm employs a greedy approach, selecting a locally optimal solution at each step to ensure that the final result approximates the global optimal solution.The algorithm uses a cost function based on Indicates that in a cost-based environment, the uneven distribution of risk costs from the current node ( x i , y i ) to the target node (x end , y end ) makes it difficult for the algorithm to select the heuristic function.
Vol  25)).It searches for path nodes with the minimum risk, expanding in the order of increasing f (n) values.This means that nodes with smaller f (n) values are expanded first, thereby finding the optimal solution.The improved algorithm reduces search space, improves speed, and prevents the algorithm from falling into the local optimal caused by the large estimation of the heuristic function.The pseudocode of the program for the Min-cost A* algorithm is shown in Fig. 8.

Calculation of the weight of the cost function
In Section "Min-cost A*algorithm", the cost function selects the sum of the city's third-party risk costs, and the risk factor weights represent the degree of influence of different risks in UAV path planning.This study uses the Analytic Hierarchy Process (AHP) to determine the weights of risk factors.The general steps of the AHP method are shown in Fig. 9.The first step of the Analytic Hierarchy Process (AHP) is to identify the objectives and their hierarchical relationships.In our case, the objective is to determine the weight relationships between obstacles, risk of death, and property damage.Therefore, this article constructs a three-level hierarchy consisting of the goal level, criteria level, and alternative level, as shown in Fig. 10.
The second step involves constructing judgment matrices to determine the relative importance between criteria and sub-criteria at each level through pairwise comparisons.In this article, the authors use the consistency matrix method along with a scale of 9 importance levels (with higher numbers indicating higher relative importance, e.g., if A is 9 relative to B, then B is 1/9 relative to A) to establish the judgment matrices, as shown in Table 2.
The third step involves using the square root method (Eq.31) to calculate the geo metric mean of the normalized elements in each row of the judgment matrix, denoted as w i .where a ij is the result of comparison between elements i and j , and the relative weight w 0 of each risk cost can be obtained by normalizing

Calculate eigenvectors and eigenvalues
Consistency check

Final decision
Decompose the decision problem

Perform eigenvalue decomposition
Examine the consistency of the decision matrix Verify consistency and make adjustments to the decision matrix.
Sum the selections based on weights  where max is the maximum eigenvalue of the judgment matrix, n is the order of the judgment matrix, and the value of R.I. refers to the table of average random consistency index shown in Table 3.The lookup table yields n =3, R.I.=0.52.C.R. is calculated as follows: C.R. < 0.1 is considered to pass the consistency test; if the conditions are not met, the judgment matrix must be checked and its value adjusted.CR. = C.I R.I. = 0.0071 0.52 = 0.0136 pass the consistency test.The specific results are shown in Table 4, so α 1 =0.0938, α 2 =0.7396, α 3 =0.1666.

Smoothing of the risk path
The result of the A* algorithm is a string of path point coordinates.The generated path is the folding line "Z" route, which does not conform to the real application.The Floyd algorithm can optimize the path, remove the extra points and inflection points of the A* algorithm path, and combine collinear node 38 .This paper realizes the smooth risk path by improving the Floyd algorithm.The path-smoothing principle of the Floyd algorithm is shown in Fig. 11.
However, in a risky environment, the traditional Floyd algorithm has the possibility of removing low-risk path coordinates.The path coordinates determined by the Min-cost A* algorithm in the risk environment is to avoid the risk area, the traditional Floyd algorithm may smooth out the coordinates of some risk areas that need to be avoided, increasing the risk of drone flight, as shown in Fig. 12a.To solve this problem, this paper sets a risk threshold for the three-dimensional risk environment, and when the risk value exceeds this threshold, the original path point is retained, smaller than the risk threshold for smooth treatment, as shown in Fig. 12b.

Simulation results
In this paper, our risk assessment model and a risk-based path planning algorithm are simulated in the urban risk map.First, the risk assessment model is applied to the actual environment to generate an airspace map.Based on the flight risk analysis, a low-risk flight path is generated and smoothed.The effectiveness of the algorithm is proved by comparing the algorithms and analyzing the experimental results.www.nature.com/scientificreports/

Flight risk analysis
In the UAV risk cost model, the weight factors of obstacle risk, death risk and property loss risk are 0.0938(α 1 ), 0.7396(α 2 ), and 0.1666(α 3 ), and the comprehensive risk cost of different flight layers is calculated.Within the restricted flight altitude of urban drones, the total flight cost decreases as the flight altitude increases, as shown in Fig. 14.In the airspace within 60 m, as shown in (a) and (b) in Fig. 14, the density of obstacles, population, and buildings is large.For example, the area near the map (5, 2), (6, 8) has the highest risk cost, then in the actual environment, such areas often include schools, office buildings, pedestrian streets, etc.When the flight altitude reaches more than 90 m, the total risk cost is significantly lower than within 60 m, as shown in (c) and (d) in Fig. 14.The reasons are as follows: the increased altitude of drones leads to a decrease in the risk of property damage, and the risk of obstacles and population density leads to a decrease in the risk of direct death, so the total cost of risk is reduced.However, the high-risk areas at flight altitudes of 90 and 120 m can still be clearly identified because there are still high-rise buildings at this altitude and the density of these buildings is related to the risk of death and accounts for 73.69%.first optimization reduces the path risk by 40.47%, the algorithm search time is increased by 63.6%, the path risk of the Min-cost A* algorithm is reduced by 44.44%, and the time is only increased by 27.2% compared with the original A* algorithm.Therefore, the Min-cost A* algorithm proposed in this paper can ensure the effective implementation of the algorithm while reducing the risk of a UAV flight path.

Effectiveness analysis of min-cost A* algorithm
To comprehensively assess the relative performance of our algorithm in this paper, we add a comparison between the Min-cost A*algorithm and the Dijkstra algorithm, particle swarm optimization algorithm (PSO), and genetic algorithm, as shown in Fig. 18.Near the map coordinates (6, 6), the Dijkstra algorithm plans paths that cross the "no-fly zone, " and as we approach the endpoint, the genetic algorithm plans paths that cross some high-risk areas.Although the paths generated by the particle swarm optimization algorithm do not exhibit instances of crossing no-fly zones or high-risk areas, they do not make reasonable avoidance maneuvers for lowerrisk areas near map coordinates (8, 8).In real-world scenarios, flight safety concerns in these areas still warrant attention.The path risks for different algorithms are presented in Table 5, and when compared to the Dijkstra algorithm, the particle swarm optimization algorithm, and the genetic algorithm, the Min-cost A* algorithm reduces path risks by 42.15%, 29.30%, and 45.31%, respectively.Additionally, it also produces the shortest paths, achieving a balance between flight path risk and path length.

Risk path smoothing
In this paper, the UAV path is smoothed according to the smoothing strategy proposed in 4.3, and the simulation results are shown in Fig. 19.The experimental results show that under the premise of satisfying flight safety, the inflection point of the path is less than that before smoothing and the path is smoother.

Algorithm effectiveness verification
Urban drones operate flexibly, so we set any flight start and end point for multiset experimental comparison, as shown in Figs. 20, 21, 22, 23.The experimental results show that compared to the traditional A* algorithm and the first optimization algorithm, the Min-cost A* algorithm can plan the flight path with the smallest risk, and the cumulative flight risk is much lower than that of the traditional A* algorithm, as shown in Table 6.
In order to further verify the safety of the algorithm path in this paper, we compare the flight path of the traditional A* algorithm and the Min-Cost traditional A* algorithm in different risk areas, and the example map is shown in Fig. 24.In areas with low urban risk Fig. 24a (such as green areas), the total risk gap between the A* algorithm and the Min-cost A* algorithm is small, because such areas themselves have fewer buildings and population distribution, and the airspace is spacious.When the drone is operated in a high-risk area of city Fig. 24b (such as a pedestrian street), the total risk of the Min-cost A* algorithm path is significantly lower than

Figure 1 .
Figure 1.Schematic diagram of urban environmental risk factors.In the figure, the main risks associated with drones include the risk to ground personnel, the risk to buildings, and the risk of direct fatalities caused by drones.

Figure 2 .
Figure 2. Schematic diagram of the division of low-altitude urban airspace.Note: (a) The different colors of the air block represent different degrees of risk, the brighter the color, the higher the risk; (b) indicates that the drone flight path in the risk air block unit will avoid the high-risk gas block; (c) is a schematic diagram of the drone flight path in a three-dimensional risk environment.

Figure 4 .
Figure 4.The drone crash stage division.The process of a drone falling can be divided into three stages: system failure, drone descent, and injury to personnel caused by the descent.

2 Figure 5 .
Figure 5. Schematic diagram of drone falling from height of h.The descent of a drone with a certain weight from a height h in the air generates a certain amount of kinetic energy, which is one of the factors influencing the fatality risk.

Figure 6 .
Figure 6.Changes in building height.In urban environments, unevenly spaced buildings can impact the safety of drone flights.Drone crashes and collisions can result in property damage.

Figure 7 .
Figure 7. Heuristic values in different environments.Note: (a) indicates that in distance-based environment, Manhattan distance and Euclidean distance are used as the traditional A* algorithm heuristic distance.(b)Indicates that in a cost-based environment, the uneven distribution of risk costs from the current node ( x i , y i ) to the target node (x end , y end ) makes it difficult for the algorithm to select the heuristic function.

Figure 8 .
Figure 8.The pseudocode flowchart for the Min-cost A* algorithm.Note that Current represents Store's current location (a collection), OPEN represents Storage low-risk nodes, CLOSED represents Storage nonoptional nodes, high-risk cost nodes.

w 0 :
Finally, check the consistency of the judgment matrix.The consistency indicators are C.I. , R.I. and C.R. ( C.I. is the consistency index, R.I. is the random index, and C.R. is the consistency ratio), and the calculation of C.I. is as follows:

Figure 9 .Figure 10 .
Figure 9. Process of using Analytic Hierarchy Process (AHP) to solve a flowchart.The complete solving steps are divided into the aforementioned 8 parts.This article uses this method to calculate the risk weights.

Figure 11 .
Figure 11.Schematic diagram of the Floyd algorithm.The Floyd algorithm is used for path smoothing to eliminate adjacent collinear points and redundant turning points.

Figure 12 .
Figure 12.Smooth comparison of UAV paths in the risk environment.(a) Indicates that the traditional Floyd algorithm may smooth out the risk inflection points, causing the UAV's flight path to pass through excessively high-risk areas.(b) Indicates that the improved Floyd algorithm ensures flight safety while smoothing the path.

Figure 13 .
Figure13.Comprehensive airspace risk simulation map.The brighter the color on the map, the higher the risk for the area.

Figure 14 .
Figure 14.Risk cost map for different flight altitudes.The diagram illustrates risk zones at altitudes of 30 m, 60 m, 90 m, and 120 m.Due to factors such as buildings and population, lower-altitude maps display a higher density of risk areas.

Figure 15 .
Figure 15.UAV flight paths with different algorithms.Note: Dark red in (a) indicates the "no-fly zone" and in (b) the cylinder indicates the three-dimensional space no-fly zone.

Figure 16 .
Figure 16.Path risk comparison.Once the number of search nodes exceeds 80, the Min-cost A* algorithm offers the lowest path risk.

Figure 17 .
Figure 17.Algorithm time comparison.The Min-cost A* algorithm strikes a balance between path risk and search time.
diagram of the flight path of the drone.Three-dimensional diagram of the flight path of the drone.

Figure 18 .
Figure 18.Comparison of Min-cost A* with other advanced algorithms.Note that this paper com pares Dijkstra algorithm, particle swarm optimization (PSO) algorithm, and genetic algorithm.In (a), deep red indicates "no-fly zones, " and in (b), cylindrical shapes represent three-dimensional airspace restrictions.

Figure 19 .
Figure 19.Path smoothing comparison chart.The smoothed path, while ensuring path safety, removes adjacent collinear points and unnecessary turning points.

Figure 20 .
Figure 20.Comparison of the UAV flight path and path risk with different algorithms.This set of simulations starts at (60, 10, 5) and ends at (60, 60, 10).

Figure 21 .
Figure 21.Comparison of the UAV flight path and path risk with different algorithms.This set of simulations starts at (20, 30, 8) and ends at (60, 60, 12).
Comparison of UAV flight paths with different algorithms.Comparison of UAV path risk of different algorithms.

Figure 22 .
Figure 22.Comparison of the UAV flight path and path risk with different algorithms.This set of simulations starts at(20, 20, 25) and ends at (99, 99, 20).
Comparison of UAV flight paths with different algorithms.Comparison of UAV path risk of different algorithms.

Figure 23 .
Figure 23.Comparison of the UAV flight path and path risk with different algorithms.This set of simulations starts at (70, 20, 6) and ends at (30, 90, 10).
Urban medium-risk flight areas.Urban low-risk flight areas.Urban medium to high-risk flight areas.High-risk urban flight areas.

Figure 26 .
Figure 26.Schematic diagram of UAV path planning in different risk environments.Note: The yellow line indicates the flight path planned by the traditional A* algorithm, and the green line indicates the flight path planned by the Min-cost A* algorithm.

Figure 27 .
Figure 27.Path-risk comparison of different algorithms.The Min-cost A* algorithm has lower path risk compared to the traditional A* algorithm in any area of the city (high-risk, medium to high-risk, medium-risk, and low-risk flying areas).

Table 1 .
Symbol definitions in this study.These symbols are distributed across the following three sections: (1) Third-Party Risk Modeling and Assessment, (2) UAV Path Planning Modeling, and (3) Algorithmic Solutions.

Table 5 .
Comparison of Path Risks between Min-cost A* Algorithm and Other Algorithms.Min-cost A* Algorithm shows a 0% decrease in risk when compared to itself. Min-

Table 6 .
Comparison of the experimental results of different path planning algorithms.